package CutLoad.transitions
{
	import CutLoad.cookies.Painter;
	import CutLoad.transitions.TBase;
	
	import flash.display.Bitmap;
	import flash.display.DisplayObject;

	/**
	 * 对当前的显示对象进拍照，并隐藏显示对像，对照片图像，进行一些循环操作（这个由你来确定）.
	 * @author Administrator
	 * 
	 */	
	public class PhotoMeAndToDo extends TBase
	{
		//目标
		private var target:DisplayObject; 
		//照片
		private var photo:Bitmap;
		public function PhotoMeAndToDo(target:DisplayObject,isVisible:Boolean=false)
		{
			this.target=target;
			target.visible=isVisible;
			rePhoto();
		}
		public function rePhoto():void{
			photo=Painter.getImg(target);
		}
		override public function start(someData:TransitionsData=null):void{
			super.start();
		}
		override public function enterFrame():void
		{
			if(photo!=null){
				if(funEnterFrame!=null)	this.funEnterFrame(photo,this);
			}
		}
		/**
		 * 设计循环操作 
		 * @param fun  格式:function(photo:Bitmap,me:PhotoMeAndToDo);
		 * 
		 */		
		override public function setFunEnterFrame(fun:Function):void{
			super.setFunEnterFrame(fun);
		}
		/**
		 * 此方法已禁止
		 * @param fun
		 * 
		 */		
		override public function setFunEnd(fun:Function):void{
			throw new Error("此方法禁止调用");
		}
		
	}
}